package com.qf.service.Impl;

import com.qf.dao.AccountDao;
import com.qf.service.AccountService;

import java.math.BigDecimal;

/**
 * @author mkr
 * @version V1.0
 * @Project spring_demo
 * @Package com.qf.service.Impl
 * @Description:
 * @Date 2022/7/12 10:05
 */
public class AccountServiceImpl implements AccountService {

    private AccountDao accountDao;

    public void setAccountDao(AccountDao accountDao) {
        this.accountDao = accountDao;
    }

    @Override
    public void transfer(String cardNo, String toCardNo, BigDecimal money) {
        //转账账户扣钱
        accountDao.minusUpdate(cardNo,money);

        //转入账号收款
        accountDao.plusUpdate(toCardNo,money);
    }
}
